﻿/**
 * @file MainForm
 *
 * @brief 
 *
 * @author gyzheng
 *
 * @mail gyazheng@gmail.com
 *
 * @date 07/27/2011 22:37:51 
 *
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using CarFrameWork.Model;
using CarFrameWork.UI.Common;

namespace CarFrameWork.UI.SystemManage.RoleManage
{
    public partial class RoleFormBase : DetailForm
    {
        protected RoleInfo m_RoleInfo;
        public RoleFormBase()
        {
            InitializeComponent();
        }

        private bool InspectionText(TextBox text)
        {
            if (string.Empty == text.Text.Trim())
                return false;
            return true;
        }

        protected bool TestContent()
        {
            if (!InspectionText(this.txtName))
                return false;
            if (!InspectionText(this.txtMemo))
                return false;
            return true;
        }

        public void SetRoleToForm()
        {
            txtID.Text = m_RoleInfo.RoleID.ToString();
            txtName.Text = m_RoleInfo.RoleName;
            txtMemo.Text = m_RoleInfo.Description;
        }

        public void GetFormToRole()
        {
            m_RoleInfo.RoleName = txtName.Text;
            m_RoleInfo.Description = txtMemo.Text;
        }

        private void btnSelectChildren_Click(object sender, EventArgs e)
        {
            //CommonModule.SelectAllChildNodesOfCurrentNode(tvModule.SelectedNode);
        }

        private void quitBtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
